<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
    <![endif]-->
    <title></title>
</head>
<body>
<div class="contant">
<div class="row">
        <div class="top">首页>公检法查询</div>
        <div class="content addapply">
            <div class="fl">
                <div class="box all-box">
                    <h1>客户信息<span>(标*为必填项)</span></h1>
                    <div class="list-block">
                        <div class="row">
                            <input id="telephone" type="hidden" value={$info.telephone}>
                            <input id="report-id" type="hidden" value={$info.report_id}>
                            <input id="apply-id" type="hidden" name="applyId" value={$info.entry_no}>
                            <label>姓名: <i class="required">*</i></label>
                            <input id="user-name" disabled type="text" name="" value={$info.user_name}>
                            <label>身份证号: <i class="required">*</i></label>
                            <input id="identy-no" disabled style="width: 160px;" type="text" name="" value={$info.identity_no}>
                            <label>贷款银行: <i class="required">*</i></label>
                            <input disabled type="text" name=""  value={$info.bank_name}>
                        </div>
                        <div class="row">
                            <label>上传照片: <i class="required">*</i></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.identity_photo_pros}" class="preview" rel="{$info.identity_photo_pros}"><img class="pic" src="{$info.identity_photo_pros}" ><i>身份证正面</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.identity_photo_cons}" class="preview" rel="{$info.identity_photo_cons}"><img class="pic" src="{$info.identity_photo_cons}" ><i>身份证反面</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.credit_authorize_photo}" class="preview" rel="{$info.credit_authorize_photo}"><img class="pic" src="{$info.credit_authorize_photo}" ><i>征信授权书</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.credit_authorize_up}" class="preview" rel="{$info.credit_authorize_up}"><img class="pic" src="{$info.credit_authorize_up}" ><i>征信授权书抬头</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.credit_authorize_down}" class="preview" rel="{$info.credit_authorize_down}"><img class="pic" src="{$info.credit_authorize_down}" ><i>征信授权书低头</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.table_credit_photo}" class="preview" rel="{$info.table_credit_photo}"><img class="pic" src="{$info.table_credit_photo}" ><i>征信表格照片</i></a></label>
                        </div>
                        <div class="row {$info['spouse_name']?'':'sr-only'}">
                            <label>配偶姓名: <i class="required">*</i></label>
                            <input disabled type="text" name="" value={$info.spouse_name}>
                            <label>身份证号: <i class="required">*</i></label>
                            <input disabled style="width: 160px;" type="text" name="" value={$info.spouse_identity_no}>
                        </div>
                        <div class="row {$info['spouse_name']?'':'sr-only'}">
                            <label>上传照片: <i class="required">*</i></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.spouse_id_photo_pros}" class="preview" rel="{$info.spouse_id_photo_pros}"><img class="pic" src="{$info.spouse_id_photo_pros}" ><i>身份证正面</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.spouse_id_photo_cons}" class="preview" rel="{$info.spouse_id_photo_cons}"><img class="pic" src="{$info.spouse_id_photo_cons}" ><i>身份证反面</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.spouse_credit_photo}" class="preview" rel="{$info.spouse_credit_photo}"><img class="pic" src="{$info.spouse_credit_photo}" ><i>征信授权书</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.spouse_credit_up}" class="preview" rel="{$info.spouse_credit_up}"><img class="pic" src="{$info.spouse_credit_up}" ><i>征信授权书抬头</i></a></label>
                            <label class="inputfile" for=""><a target="_blank" href="{$info.spouse_credit_down}" class="preview" rel="{$info.spouse_credit_down}"><img class="pic" src="{$info.spouse_credit_down}" ><i>征信授权书低头</i></a></label>
                        </div>
                        <volist name="assure" id="assure_data">
                            <div class="row">
                                <label>担保人姓名: <i class="required">*</i></label>
                                <input disabled type="text" name="" value={$assure_data.user_name}>
                                <label>身份证号: <i class="required">*</i></label>
                                <input disabled style="width: 160px;" name="" value={$assure_data.identity_no}>
                            </div>
                            <div class="row">
                                <label>上传照片: <i class="required">*</i></label>
                                <label class="inputfile" for=""><a target="_blank" href="{$assure_data.assume_credit_photo}" class="preview" rel="{$assure_data.assume_credit_photo}"><img class="pic" src="{$assure_data.assume_credit_photo}" ><i>身份证正面</i></a></label>
                                <label class="inputfile" for=""><a target="_blank" href="{$assure_data.assure_id_photo_pros}" class="preview" rel="{$assure_data.assure_id_photo_pros}"><img class="pic" src="{$assure_data.assure_id_photo_pros}" ><i>身份证反面</i></a></label>
                                <label class="inputfile" for=""><a target="_blank" href="{$assure_data.assure_id_photo_cons}" class="preview" rel="{$assure_data.assure_id_photo_cons}"><img class="pic" src="{$assure_data.assure_id_photo_cons}" ><i>提交征信授权书</i></a></label>
                                <label class="inputfile" for=""><a target="_blank" href="{$assure_data.credit_up_photo}" class="preview" rel="{$assure_data.credit_up_photo}"><img class="pic" src="{$assure_data.credit_up_photo}" ><i>征信授权书抬头照</i></a></label>
                                <label class="inputfile" for=""><a target="_blank" href="{$assure_data.credit_down_photo}" class="preview" rel="{$assure_data.credit_down_photo}"><img class="pic" src="{$assure_data.credit_down_photo}" ><i>征信授权书低头照</i></a></label>
                            </div>
                        </volist>
                    </div>
                </div>
            </div>
            <div class="fr">
            <form id="applyForm" method="post">
                <div class="box all-box">
                    <h1>信用记录</h1>
                    <div class="list-block">
                        <div class="row">
                            <label>借款人信息:<i class="required">*</i></label>
                            <input id="apply-status" type="hidden" name="check_status" value={$info.status}>
                            <input type="hidden" name="user_id" value={$info.id}>
                            <textarea name="master_info" id="" cols="38" rows="5">{$info.master_info}</textarea>
                        </div>
                        <div class="row {$info['spouse_name']?'':'sr-only'}">
                            <label>配偶人信息:<i class="required">*</i></label>
                            <textarea name="spouse_info" id="" cols="38" rows="5">{$info.spouse_info}</textarea>
                        </div>
                        <volist  name="assure" id="assure_info" >
                            <div class="row">
                                <label>担保人信息:<i class="required">*</i></label>

                                <input type="hidden" value="{$assure_info.id}" name="aids[]">
                                <textarea name="assure_{$assure_info.id}" id="" cols="38" rows="5">{$assure_info.assure_info}</textarea>
                            </div>
                        </volist>
                    </div>
                    <div class="list-block">
                        <input id="gjf-adopt" type="submit" class="btn btn-success" value="通过" name="">
                        <input id="gjf-reject" type="button" class="btn btn-danger" value="驳回" name="">
                        <input id="request-credit" type="button" class="btn btn-warning" value="提交公检法" name="">
                        <input id="show-credit" type="button" class="btn btn-warning" value="查询结果" name="">
                    </div>
                </div>
                </form>
            </div>
        </div>
    </div>
</div>
<style type="text/css">
    i{cursor: pointer;}
    .pic{
        width:138px;
        height:118px;
        border-radius:0% ;
        cursor: pointer;
        background: #fff;
        /*position: absolute;
        */z-index: 1;
    }

    #preview{
        position:absolute;border:1px solid #ccc;
        background:#333;padding:3px;display:none;color:#fff;
        opacity: .9;
    }
</style>

<script type="text/javascript">

//    this.imagePreview = function(){
//        xOffset = 10;
//        yOffset = 30;
//
//        $("a.preview").hover(function(e){
//                    this.t = this.title;
//                    this.title = "";
//                    var c = (this.t != "") ? "<br/>" + this.t : "";
//                    $("body").append("<div id='preview'><img width=600 src='"+ this.rel +"' alt='Image preview' />"+ c +"</div>");
//                    $("#preview")
//                            .css("top",(e.pageY - xOffset) + "px")
//                            .css("left",(e.pageX + yOffset) + "px")
//                            .fadeIn("fast");
//                },
//                function(){
//                    this.title = this.t;
//                    $("#preview").remove();
//                });
//        $("a.preview").mousemove(function(e){
//            $("#preview")
//                    .css("top",(e.pageY - xOffset) + "px")
//                    .css("left",(e.pageX + yOffset) + "px");
//        });
//    };


    // starting the script on page load
    $(document).ready(function(){
        imagePreview();
    });

     // 审核通过
    $('#gjf-adopt').click(function(){
        $('#apply-status').val(-2);
        if (confirm('确认通过吗？')==true){
            $('#applyForm').submit();
        }else{
          return false;
        }
    });

    // 驳回
    $('#gjf-reject').click(function(){
        $('#apply-status').val(902);
        if (confirm('确认驳回吗？')==true){
            $('#applyForm').submit();
        }else{
          return false;
        }
    });

    $('#request-credit').click(function(){
        telephone            = $('#telephone').val();
        user_name            = $('#user-name').val();
        identy_no            = $('#identy-no').val();
        user_id              = $('#user-id').val();
        apply_id             = $('#apply-id').val();
        first_commit_time    = $('#first-commit-time').val();
        mate_name            = $('#mate-name').val();
        mate_idty            = $('#mate-idty').val();
        contact1Name         = $('#contactor1name').val();
        contact1Mobile       = $('#contactor1mobile').val();
        contact1Relationship = $('#contactor1relationship').val();
        contact2Name         = $('#contactor2name').val();
        contact2Mobile       = $('#contactor2mobile').val();
        contact2Relationship = $('#contactor2relationship').val();
        console.log(telephone,user_name,identy_no);

        $.ajax(
        {
            type: "POST",
            url: "__URL__/credit_check",
            data:
            {
                mobile:telephone,
                name:user_name,
                idty:identy_no,
                userid:user_id,
                applyId:apply_id,
                firstCommitTime:first_commit_time,
                mateName:mate_name,
                mateIdty:mate_idty,
                mateMobile:'',
                company:'',
                address:'',
                contact1Name:'杨新太',
                contact1Mobile:'13634363317',
                contact1Relationship:'朋友',
                contact2Name:'王栢峰',
                contact2Mobile:'18043654660',
                contact2Relationship:'朋友'
            },

            success: function(msg)
            {
                obj_data = $.parseJSON(msg);
                console.log(obj_data);
                strNote ='';

                switch(obj_data['applyResult'])
                {
                    case '000': strNote  = '审批通过';break;
                    case '0001': strNote = '审批中';break;
                    case '0002': strNote = '审批拒绝';break;
                    case '0003': strNote = '存在法院非经济案件';break;
                }

                // $('.page-header').html('央行征信接口---<font color="red">'+strNote+'</font>');
                alert('央行征信接口：'+strNote);
           }
        });
    });

    $('#show-credit').click(function(){
        apply_id = $('#apply-id').val();

        $.ajax({
           type: "POST",
           url: "__URL__/check_result",
           data: {applyId:apply_id},
           success: function(msg){
            obj_data = $.parseJSON(msg);
            console.log(obj_data.lr[0]);

            strNote = '';
            if (obj_data.lr[0] == "" || obj_data.lr[0] == undefined || obj_data.lr[0] == null) {
                strNote = '暂无该applyId对应的信息';
            }else{
                switch(obj_data.lr[0].applyResult){
                    case '000': strNote  = '审批通过';break;
                    case '0001': strNote = '审批中';break;
                    case '0002': strNote = '审批拒绝';break;
                    case '0003': strNote = '存在法院非经济案件';break;
                }
                strNote += obj_data.lr[0].applyResultReason;
            }

            $('#extra-info').append('<div>'+strNote+'</div>');
           }
        });
    });

</script>
</body>
</html>